package com.chap15;


import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

/**
 * <p>
 * <code>OrderEventHandler</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-04-18 14:53
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
public class OrderEventHandler implements EventHandler<OrderEvent>, WorkHandler<OrderEvent> {

    @Override
    public void onEvent(OrderEvent event, long sequence, boolean endOfBatch) throws Exception {
        System.out.println("消费者"+Thread.currentThread().getName()+"获取数据value："+event.getValue()+",name:"+event.getName());
    }

    @Override
    public void onEvent(OrderEvent event) throws Exception {
        System.out.println("消费者"+Thread.currentThread().getName()+"获取数据value："+event.getValue()+",name:"+event.getName());
    }
}
